package com.aaa.distincklock.controller;

import com.aaa.distincklock.service.StockService_redisson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @author:LiWei
 * @date:2022年12月08日16:58
 */
@RestController
public class StockController {
    @Autowired
    private StockService_redisson stockService;

    @GetMapping("/incr/{productid}")
    public String incr(@PathVariable Integer productid){
        return stockService.decrement(productid);
    }
}
